function viewMyResume(isFile) {
  const userId = localStorage.getItem('userId');
  console.log('Requesting resume for userId:', userId);

  if (userId) {
    fetch(`http://192.168.244.14:8080/resumeStatus/view/${userId}/${isFile}`)
      .then(response => {
        if (!response.ok) {
          throw new Error('网络响应错误：' + response.status);
        }
        return response.json();
      })
      .then(data => {
        console.log('Response data:', data);
        if (data && data.code === 1) {
          const content = data.data;
          if (!content || content === '') {
            alert('无法查找到简历信息, 用户没有用该方式提交简历');
            return;
          }
          localStorage.setItem('resumeData', JSON.stringify(data.data));
          if (isFile === 0 || 1) {
            window.location.href = "http://127.0.0.1:5501/sparkResume/html/checkResume.html";
          } else {
            window.location.href = "http://127.0.0.1:5501/sparkResume/html/checkResume.html";
          }
        } else {
          alert('未找到您的简历信息：' + (data && data.msg ? data.msg : '未知错误'));
        }
      })
      .catch(error => {
        console.error('查看简历请求出错:', error);
        alert('查看简历请求出错，请检查网络连接');
      });
  } else {
    alert('请先登录');
  }
}
function viewResume(userId) {
  fetch(`http://192.168.244.14:8080/resumeStatus/view/${userId}`)
    .then(response => {
      if (!response.ok) {
        throw new Error('网络响应错误：' + response.status);
      }
      return response.json();
    })
    .then(data => {
      if (data && data.code === 1) {
        localStorage.setItem('resumeData', JSON.stringify(data.data));
        window.location.href = "http://127.0.0.1:5501/sparkResume/html/checkResume.html";
      } else {
        alert('获取简历失败：' + (data && data.msg ? data.msg : '未知错误'));
      }
    })
    .catch(error => {
      console.error('获取简历请求出错:', error);
      alert('获取简历请求出错，请检查网络连接');
    });
}